﻿@using Entidades.Sistema.Venta
@using Entidades.Sistema.Base
@using System.Collections.ObjectModel;
@using System.Collections.Generic;
@using System.Linq;

@model Cliente
@{
    Html.EnableClientValidation();
    Html.EnableUnobtrusiveJavaScript();
    
    ReadOnlyCollection<Barrio> _barrioList = (ReadOnlyCollection<Barrio>)ViewBag.Barrio;
    ReadOnlyCollection<Localidad> _localidadList = (ReadOnlyCollection<Localidad>)ViewBag.Localidad;
    ReadOnlyCollection<Provincia> _provinciaList = (ReadOnlyCollection<Provincia>)ViewBag.Provincia;
}

@Html.DevExpress().ComboBox(
            settings => {
                settings.Name = "Barriox";
                settings.CallbackRouteValues = new { Controller = "Cliente", Action = "ComboBoxBarrioPartial" };
                settings.ControlStyle.CssClass = "editor";
                settings.Properties.TextField = "Nombre";
                settings.Properties.ValueField = "IdBarrio";
                settings.Properties.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith;
                settings.Properties.DropDownStyle = DropDownStyle.DropDown;
                settings.Properties.ValueType = typeof(int);
                settings.Properties.ClientSideEvents.BeginCallback = "function(s, e) { e.customArgs['Localidad'] = Localidad.GetValue(); }";
                settings.Properties.ValidationSettings.Display = Display.None;
            }
).BindList(_barrioList.Where(x => x.Localidad.IdLocalidad == Model.Barrio.Localidad.IdLocalidad).ToList()).Bind(Model.Barrio.IdBarrio).GetHtml()






